package com.mililoan.service.module.system.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mililoan.common.bean.PageResultSet;
import com.mililoan.model.system.OpLog;
import com.mililoan.persist.system.OpLogDao;
import com.mililoan.service.module.system.OpLogBo;

/**
 * @ClassName: OpLogBoImpl
 * @Description: 接口实现类
 * @author taochen 
 * @since 2017-08-26
 */
@Service("OpLogBo")
public class OpLogBoImpl implements OpLogBo{	
	@Autowired
	private OpLogDao opLogDao;
	
	/**
	 * @Title: queryOpLogList
	 * @Description: 分页查询
	 * @param opLog
	 * @param page
	 * @param pageSize
	 * @return
	*/
	public PageResultSet<OpLog> queryOpLogList(OpLog opLog, int page, int pageSize) throws Exception{
		PageResultSet<OpLog> prs = opLogDao.queryOpLogList(opLog, page, pageSize);
		return prs;
	}

	/**
	 * @Title: add
	 * @Description: 添加
	 * @param opLog
	 * @return
	 * @throws Exception 
	*/
	@Transactional(rollbackFor=Exception.class)
	public Long addOpLog(OpLog opLog) throws Exception {	
		return opLogDao.add(opLog);
	}

	/**
	 * @Title: update
	 * @Description: 修改
	 * @param opLog
	 * @return
	 * @throws Exception 
	*/
	public Long updateOpLog(OpLog opLog) throws Exception {
		return opLogDao.update(opLog);
	}

	/**
	 * @Title: delete
	 * @Description: 删除
	 * @param KeyId
	 * @return
	 * @throws Exception 
	*/
	public Long deleteOpLog(Long keyId) throws Exception {		
		return opLogDao.delete(keyId);
	}

	/**
	 * @Title: queryOpLogById
	 * @Description: 查询单个对象
	 * @param KeyId
	 * @return
	 * @throws Exception 
	*/
	public OpLog getOpLogById(Long keyId) throws Exception {
		return opLogDao.getOpLogById(keyId);
	}
}